package com.chart.chart.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chart.chart.domian.ChartConfigs;
import com.chart.chart.domian.ChartConfigsAndViewsVo;
import com.chart.chart.domian.ChartConfigsUser;
import com.chart.chart.domian.vo.ChartConfigsUserVo;
import com.chart.chart.mapper.ChartConfigsMapper;
import com.chart.chart.mapper.ChartConfigsUserMapper;
import com.chart.chart.service.IChartConfigsService;
import com.chart.chart.service.IChartConfigsUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

import static com.chart.common.utils.PageUtils.startPage;

/**
 * 用户 业务层处理
 * 
 * @author ruoyi
 */
@Service
public class ChartConfigsUserServiceImpl extends ServiceImpl<ChartConfigsUserMapper, ChartConfigsUser> implements IChartConfigsUserService
{
    @Autowired
    private ChartConfigsUserMapper chartConfigsUserMapper;

    @Override
    public List<ChartConfigsUserVo> getListWithOutValue(ChartConfigsUserVo chartConfigsUserVo) {
        return chartConfigsUserMapper.getListWithOutValue(chartConfigsUserVo);
    }

    @Override
    public List<ChartConfigsAndViewsVo> getChartsAndViews(ChartConfigsUser configsUser) {
        startPage();
        List<ChartConfigsAndViewsVo> chartsAndViews = chartConfigsUserMapper.getChartsAndViews(configsUser);
        return chartsAndViews;
    }

    @Override
    public List<ChartConfigsAndViewsVo> getChartsAndViewsBathByFileIds(List<Long> ids) {
        return chartConfigsUserMapper.getChartsAndViewsBathByFileIds(ids);
    }

    @Override
    public boolean scatterChartfigsUser(List<ChartConfigsUser> collect) {
        return chartConfigsUserMapper.scatterChartfigsUser(collect);
    }

    @Override
    public List<ChartConfigsAndViewsVo> getChartsAndViewsBatch(ChartConfigsAndViewsVo chartConfigsAndViewsVo) {
        return chartConfigsUserMapper.getChartsAndViewsBatch(chartConfigsAndViewsVo);
    }

    @Override
    public List<ChartConfigsAndViewsVo> getInfoByName(ChartConfigsAndViewsVo chartConfigsAndViewsVo) {
        return chartConfigsUserMapper.getInfoByName(chartConfigsAndViewsVo);
    }

    @Override
    public List<ChartConfigsAndViewsVo> getFiles(ChartConfigsAndViewsVo chartConfigsAndViewsVo) {
        return  chartConfigsUserMapper.getFiles(chartConfigsAndViewsVo);
    }

    @Override
    public boolean updateConfigTop(ChartConfigsUser chartConfigsUser) {
        return chartConfigsUserMapper.updateConfigTop(chartConfigsUser);
    }
}
